﻿@using Smartstore.Admin.Models.Common

@model CollectionGroupModel

<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />

@(Html.LocalizedEditor<CollectionGroupModel, CollectionGroupLocalizedModel>("collection-group-localized",
    @<div class="adminContent">
        <div class="adminRow">
            <div class="adminTitle">
                <smart-label asp-for="Locales[item].Name" />
            </div>
            <div class="adminData">
                @*IMPORTANT: Do not delete, this hidden element contains the id to assign localized values to the corresponding language *@
                <input asp-for="Locales[item].LanguageId" type="hidden" />
                <input asp-for="Locales[item].Name" />
                <span asp-validation-for="Locales[item].Name"></span>
            </div>
        </div>
    </div>
    ,
    @<div class="adminContent">
        <div class="adminRow">
            <div class="adminTitle">
                <smart-label asp-for="Name" />
            </div>
            <div class="adminData">
                <input asp-for="Name" />
                <span asp-validation-for="Name"></span>
            </div>
        </div>
    </div>
))

<div class="adminContent">
    @if (Model.Id == 0)
    {
        <div class="adminRow">
            <div class="adminTitle">
                <smart-label asp-for="EntityName" />
            </div>
            <div class="adminData">
                <select asp-for="EntityName" asp-items="ViewBag.EntityNames"></select>
                <span asp-validation-for="EntityName"></span>
            </div>
        </div>
    }
    else
    {
        <div class="adminRow">
            <div class="adminTitle">
                <smart-label asp-for="LocalizedEntityName" />
            </div>
            <div class="adminData">
                <input asp-for="EntityName" type="hidden" />
                <input asp-for="LocalizedEntityName" sm-plaintext="true" readonly />
            </div>
        </div>
    }
    <div sm-if="Model.Id != 0" class="adminRow">
        <div class="adminTitle">
            <smart-label asp-for="NumberOfAssignments" />
        </div>
        <div class="adminData">
            <input asp-for="NumberOfAssignments" sm-plaintext="true" readonly />
            <span asp-validation-for="NumberOfAssignments"></span>
        </div>
    </div>
    <div class="adminRow">
        <div class="adminTitle">
            <smart-label asp-for="Published" />
        </div>
        <div class="adminData">
            <input asp-for="Published" />
            <span asp-validation-for="Published"></span>
        </div>
    </div>
    <div class="adminRow">
        <div class="adminTitle">
            <smart-label asp-for="DisplayOrder" />
        </div>
        <div class="adminData">
            <editor asp-for="DisplayOrder" />
            <span asp-validation-for="DisplayOrder"></span>
        </div>
    </div>
</div>
